package com.ys.emp.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ys.emp.dao.TblEmpMapper;
import com.ys.pojo.TblEmp;
import com.ys.pojo.TblMenu;
@Service
public class EmpService {
	@Autowired
	private TblEmpMapper empDao;

	public Map<String, Object> getEmpByName(TblEmp emp) {
		Map<String, Object> map = new HashMap<String,Object>();
		TblEmp emp2 = empDao.getEmpByName(emp.getUsername());
		if(emp2==null){
			map.put("msg", "查无此人");
		}else{
			//if(emp.getPwd().equals(emp2.getPwd())){
				map.put("msg", "登陆成功");
				map.put("emp", emp2);
			//}else{
			//	map.put("msg", "密码输入错误");
			//}
		}
		return map;
	}

	public List<TblMenu> getTblMenu(Integer uuid) {
		return empDao.getTblMenu(uuid);
	}
}
